<%@ page import="ird.demo.common.DemoConstant" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript">
function selectTran(tranCk){
	//alert(tranCk.val());
}

function preValidate(){
	//alert($('tranId'));
	var tranIds = "";
	$('input:checkbox:checked[name="tranId"]').each(function(i) { 
		tranIds += this.value + ",";
	});
	if(tranIds.length > 0){
		tranIds = tranIds.substring(0, tranIds.length - 1);
	}
	$('#tranIds').val(tranIds);
    return true;
}

$(function() {
	$('#easyuiDg').datagrid({  
	});
});
</script>

<div class="easyui-panel" title="${actDesc}:">
	<div style="padding:10px 0 10px 60px">
	<div id="errMsgDiv" class="ui-state-error ui-corner-all" style="width:95%;display:none"></div>
    <form id="ff" action="<c:url value='/transaction/IRSM0003/done' />" validateUrl="<c:url value='/transaction/IRSM0003/validAndUpd/${act}' />" method='post'>
    	<input type="hidden" name="tranIds" id="tranIds">
    	<table>
    		<tr>
    			<td>Transaction Group:</td>
    			<td>
    				<c:choose>
					<c:when test="${act == 'add'}">
						<input name="tranGrp" id="tranGrp" class="easyui-validatebox" required="true"/>
					</c:when>
					<c:otherwise>
						${tranGrp.tranGrp}<input type="hidden" name="tranGrp" id="tranGrp" value="${tranGrp.tranGrp}">
					</c:otherwise>
					</c:choose>
    				
    			</td>
    		</tr>
    		<tr><td colspan="2">&nbsp;</td></tr>
    		<tr>
    			<td>Transaction Group Description:</td>
    			<td><input class="easyui-validatebox" name="tranGrpDesc" id="tranGrpDesc" style="width: 350px"  value="${tranGrp.tranGrpDesc}"></td>
    		</tr>
    		<tr><td colspan="2">&nbsp;</td></tr>
    		<tr><td colspan="2">No. of Transaction in the Group:</td></tr>
    	</table>
    	</form>
   	    
			
    	<table>
    		<thead> 
	    		<tr>
	    			<th style="font-weight: bold;color:red;" align="left">Transaction</th>
	    			<th width="10"></th>
					<th style="font-weight: bold;color:red;" align="left">Transaction Description</th>
	    		</tr>
    		</thead>
    		<tbody>
	    		<c:forEach items="${tranVoList}" var="tranVo">
		    	<tr>
	    			<td>
	    				<input type="checkbox" name="tranId" id="tranId" value="${tranVo.tranId }" ${tranVo.checked } onclick="selectTran($(this))"/>
	    				${tranVo.tranId }
					</td>
					<td></td>
					<td>
						${tranVo.tranDesc }
					</td>
	    		</tr>
			    </c:forEach>
				<tr>
					<td colspan="3" hight="50">&nbsp;</td>
				</tr>
				<tr>
					<td colspan="3">
						${bodyBtns }
					</td>
				</tr>
    		</tbody>
		</table>
    </div>
</div>
